import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:'/login'
    },
    {
      path:'/index',
      redirect:'/home',
      name:'Index',
      component:()=>import('@/views/Index'),
      children:[
        {
          path:'/home',
          name:'Home',
          component:()=>import('@/views/Home')
        },
        {
          path:'/shops',
          name:'Shops',
          component:()=>import('@/views/Shops')
        },
        {
          path:'/prolist',
          name:'Prolist',
          component:()=>import('@/views/Prolist')
        },
        {
          path:'/category',
          name:'Category',
          component:()=>import('@/views/Category')
        },
        {
          path:'/order',
          name:'Order',
          component:()=>import('@/views/Order')
        },
        {
          path:'/userInfo',
          name:'UserInfo',
          component:()=>import('@/views/UserInfo')
        }
      ]
    },
    {
      path:'/login',
      name:'Login',
      component:()=>import('@/views/Login')
    }
  ]
})
